package com.ruoyi.web.controller.workflow;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.workflow.domain.CarPackageAudit;
import com.ruoyi.workflow.service.IDoTaskService;
import com.ruoyi.workflow.service.IDoneTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.rmi.ServerException;

/**
 * 套餐审核Controller
 *
 * @author lhl
 * @date 2022-11-18
 */
@RestController
@RequestMapping("/workflow/done")
public class DoneTaskController extends BaseController
{
     @Autowired
     private IDoneTaskService doneTaskService;
    /**
     * 查询套餐审核列表
     */
    @PreAuthorize("@ss.hasPermi('workflow:done:list')")
    @GetMapping("/list")
    public TableDataInfo list(CarPackageAudit carPackageAudit)
    {
        return doneTaskService.selectHistoryAuditList(carPackageAudit);
    }
    /**
     * 查询审批历史
     */
    @PreAuthorize("@ss.hasPermi('workflow:done:history')")
    @GetMapping("/history")
    public AjaxResult history(String instanceId)
    {

        return AjaxResult.success(doneTaskService.selectHistorySingle(instanceId));
    }
}
